//获取精选商品列表
export const getTemplateList = (data) => uni.$u.http.post('/rest/app/customProduct/templateList', data)
//获取商品详情
export const getTemplateDetail = (params) => uni.$u.http.get('/rest/app/stickerImage/get', {params})

// 获取购物车列表
export const getTrolleyList = (params) => uni.$u.http.get('/rest/app/cart/list', {params})
// 加入购物车
export const addTrolley = (data) => uni.$u.http.post('/rest/app/cart/added', data)
// 购物车移除商品
export const deleteTrolley = (data) => uni.$u.http.post('/rest/app/cart/delete', data)
// 清空购物车
export const clearTrolley = (data) => uni.$u.http.post('/rest/app/cart/clear', data)
// 勾选购物车商品
export const selectedTrolley = (data) => uni.$u.http.post('/rest/app/cart/selected', data)

// 获取区域列表
export const getAreaOptions = (params) => uni.$u.http.get('/rest/app/address/regionList', {params})
// 获取收货地址列表
export const getAddressList = (params) => uni.$u.http.get('/rest/app/address/list', {params})
// 添加收货地址
export const createAddress = (data) => uni.$u.http.post('/rest/app/address/create', data)
// 修改收货地址
export const updateAddress = (data) => uni.$u.http.post('/rest/app/address/update', data)
// 删除收货地址
export const deleteAddress = (data) => uni.$u.http.post('/rest/app/address/delete', data)
// 设置默认收货地址
export const setDefaultAddress = (data) => uni.$u.http.post('/rest/app/address/setDefaultAddress', data)


// 结算
export const checkout = (data) => uni.$u.http.post('/rest/app/order/checkout', data)
// 可用优惠券列表
export const availableList = (params) => uni.$u.http.get('/rest/app/coupon/availableList', {params})

// 提交并创建订单
export const createOrder = (data) => uni.$u.http.post('/rest/app/order/create', data)
// 支付
export const paymentOrder = (data) => uni.$u.http.post('/rest/app/order/payment', data)

// 获取订单列表
export const getOrderList = (params) => uni.$u.http.get('/rest/app/order/list', {params})

// 获取物流信息
export const getDeliveryList = (params) => uni.$u.http.get('/rest/app/delivery/list', {params})

// 获取分享精选详情
export const getShareProduct = (params) => uni.$u.http.get('/rest/app/product/getShareRecord', {
	params: params
})